Skip to content

Modernize copy prevention in factory/Registrant to use = delete#670

Open
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/registrant-modernize-copy-prevention
Open

Modernize copy prevention in factory/Registrant to use = delete#670
lyskov-ai wants to merge 1 commit intoRosettaCommons:mainfrom
lyskov-ai:refactor/registrant-modernize-copy-prevention

Conversation

@lyskov-ai
Copy link
Copy Markdown
Contributor

Summary

  • Replace old-style private-and-undefined copy constructor/assignment in utility/factory/Registrant with explicit = delete
  • Added a one-line comment explaining the non-obvious reason: each constructor calls ProductFactory::add(), so a copy would silently re-register the same key

Test plan

  • python3 ./scons.py -j16 mode=debug passes (header-only template change; no behavioral difference)

Replace old-style private-and-undefined copy constructor/assignment
with explicit = delete. A comment explains the non-obvious reason:
each constructor calls ProductFactory::add(), so a copy would
silently re-register the same key.
@lyskov lyskov requested a review from roccomoretti May 2, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants